<!--
*Author：富行天下团队

 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/MebCoupon.js此处编写
 -->
<template>
  <div>
    <VolBox :model.sync="modelXQ" title="提现申请" :width="850" :height="400">
      <VolTable
        ref="editTable1"
        :columns="columns"
        :max-height="350"
        :index="true"
        :ck="false"
        :tableData="tableData"
      >
      </VolTable>
      <div slot="footer">
        <Button @click="modelXQ = false">关闭</Button>
      </div>
    </VolBox>
  </div>
</template>

<script>
import VolBox from "@/components/basic/VolBox.vue";
import VolForm from "@/components/basic/VolForm.vue";
import VolTable from "@/components/basic/VolTable.vue";
var vueParam = {
  components: {
    VolBox,
    VolForm,
    VolTable
  },
  data() {
    return {
      modelXQ: false,
      columns: [
        {
          field: "orderId",
          title: "订单号",
          type: "string",
          width: 120
        },
        {
          field: "skuName",
          title: "产品名称",
          type: "string",
          width: 100
        },
        {
          field: "in",
          title: "单价",
          type: "decimal",
          width: 100,
          summary: true
        },
        {
          field: "commissionsCash",
          title: "佣金",
          type: "decimal",
          width: 100,
          summary: true
        },
        {
          field: "createTime",
          title: "支付时间",
          type: "string",
          width: 190
        },
        {
          field: "cardFaceIds",
          title: "卡面号",
          type: "string",
          width: 120
        }
      ],
      tableData: []
    };
  },

  methods: {
    open(e) {
      this.modelXQ = true;
      this.http
        .get("/api/erp_bill_flow_team/withdrawal_details?Id=" + e)
        .then(res => {
          this.tableData = res.data;
          let num = ["合计", "", "", 0, 0, "", ""];
          this.tableData.forEach(i => {
            for (const key in i) {
              if (key == "in") {
                num[3] += i[key];
              } else if (key == "commissionsCash") {
                num[4] += i[key];
              }
            }
          });
          this.$refs.editTable1.summaryData = num;
        });
    }
  }
};
export default vueParam;
</script>
<style lang="scss" scoped></style>
